package com.wechat.weibo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

@Component
public class WeiBo {
    int weibo_id;
    String host_openid;
    String host_name;
    String host_img;
    String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "UTC")
    Date post_time;
    String img_src;
    int like_num;
    boolean is_like=false;
    int comment_num;
    int repeat_num;

    public String getHost_img() {
        return host_img;
    }

    public void setHost_img(String host_img) {
        this.host_img = host_img;
    }

    public String getHost_name() {
        return host_name;
    }

    public void setHost_name(String host_name) {
        this.host_name = host_name;
    }

    public int getLike_num() {
        return like_num;
    }

    public void setLike_num(int like_num) {
        this.like_num = like_num;
    }

    public boolean isIs_like() {
        return is_like;
    }

    public void setIs_like(boolean is_like) {
        this.is_like = is_like;
    }

    public int getComment_num() {
        return comment_num;
    }

    public void setComment_num(int comment_num) {
        this.comment_num = comment_num;
    }

    public int getRepeat_num() {
        return repeat_num;
    }

    public void setRepeat_num(int repeat_num) {
        this.repeat_num = repeat_num;
    }

    public int getWeibo_id() {
        return weibo_id;
    }

    public void setWeibo_id(int weibo_id) {
        this.weibo_id = weibo_id;
    }

    public String getHost_openid() {
        return host_openid;
    }

    public void setHost_openid(String host_openid) {
        this.host_openid = host_openid;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getPost_time() {
        return post_time;
    }

    public void setPost_time(Date post_time) {
        this.post_time = post_time;
    }

    public String getImg_src() {
        return img_src;
    }

    public void setImg_src(String img_src) {
        this.img_src = img_src;
    }

    @Override
    public String toString() {
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        return "WeiBo{" +
                "weibo_id=" + weibo_id +
                ", host_openid='" + host_openid + '\'' +
                ", content='" + content + '\'' +
                ", post_time=" + simpleDateFormat.format(post_time)+
                ", img_src='" + img_src + '\'' +
                '}';
    }
}
